<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="ruleList" checkbox="true" fitColumns="true" title="我的考试信息" actionUrl="securityAccessExamController.do?myExamInfoDatagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>   
   <t:dgCol title="姓名"  field="user.realName"   query="false" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="开始时间"  field="beginDate" formatter="yyyy-MM-dd hh:mm" hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="结束时间"  field="endDate" formatter="yyyy-MM-dd hh:mm" hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="考试分数"  field="examScore"   query="false" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="考试结果"  field="result"  formatterjs="getResult"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="100"></t:dgCol>
   <t:dgFunOpt funname="viewDetail(id)" title="查看明细" /> 
   <t:dgToolBar title="申请考试" operationCode="Allow_Exam" icon="icon-add"   onclick="goExam()"></t:dgToolBar> 
   </t:datagrid>
  </div>
 </div>
 
 <script>
 	function viewDetail(id){
	 	window.location.href="securityAccessExamController.do?submitExam&resultId="+id;
 	}
 
 	function goExam(){
 		window.location.href="securityAccessExamController.do?goExam";
 	}
 
 	function getResult(v,rec){
 		if(rec['examScore'] >= 80){
 			return "<span style='color:green'>合格</span>";return '合格'
 		}else{
 			return "<span style='color:red'>不合格</span>";
 		}
 	}
 </script>
 